<?php
/**
 * Pipahr
 *
 * @author Randy Zhao
 * @copyright 2013 pipahr.com
 */
defined('_JEXEC') or die;

// disable core styles to avoid bs conflict
OC_Util::$core_styles = array();

if (isDevMode()) {
   OCP\Util::addStyle('interview', 'interview');
} else {
   OCP\Util::addStyle('static', 'interview');
}

$lang = PFactory::getLanguage();
$lang->load("com_jobs", JPATH_SITE, "zh-CN");

$joinurl = OC_Helper::linkToRoute("jobseeker_join");

$company_url = PInterviewHelper::getCompanyUrl($_['basicInfo']->sub_domain,0);
$company_url = $company_url ? $company_url."?utp=nocp" : '';
?>

<div class="row-fluid">
   <div class="span12">
      <div class="company_info_box clearfix">
         <div class="company_showimg pull-left">
            <?php if (!empty($company_url)) : ?>
            <a href="<?=$company_url?>" target="_blank">
               <img src="<?php echo PCompanyHelper::showCompanyAvatar($_['basicInfo']->avatar, $_['basicInfo']->avatarapproved);?>" class="cpy_logo_mid"/>
            </a>
            <?php else : ?>
            <img src="<?php echo PCompanyHelper::showCompanyAvatar($_['basicInfo']->avatar, $_['basicInfo']->avatarapproved);?>" class="cpy_logo_mid"/>
            <?php endif;?>
         </div>
         <div class="company_showinfo">
            <h4 class="yahei">
               <?php if (!empty($company_url)) : ?>
               <a href="<?=$company_url?>" target="_blank"><?=$_['basicInfo']->comp_name?></a>
               <?php else : ?>
               <?=$_['basicInfo']->comp_name?>
               <?php endif;?>
               <i class="<?php echo $_['basicInfo']->validated == EMPLOYER_VALIDATED ? "is_approve" : "not_approve";?>"></i>
            </h4>
            <ul class="company_listinfo medium">
               <li>行业：<?php echo $_['basicInfo']->industry ? JText::_($_['basicInfo']->industry) : '未填写';?></li>
               <li>性质：<?php echo $_['basicInfo']->comp_type ? JText::_($_['basicInfo']->comp_type) : '未填写';?></li>
               <li>规模：<?php echo $_['basicInfo']->size_type ? JText::_($_['basicInfo']->size_type) : '未填写';?></li>
               <li>所在地区：<?php echo !empty($_['basicInfo']->cstate) || !empty($_['basicInfo']->ccity) ? $_['basicInfo']->cstate.$_['basicInfo']->ccity : "未填写";?></li>
            </ul>
         </div>
      </div>
   </div>
</div>

<div class="container">
   <div class="row-fluid">
      <div class="span12 blackbottom">
         <div class="company_position_show clearfix">
            招聘职位：<?php echo $_['basicInfo']->job_title ? $_['basicInfo']->job_title : '未填写';?> |
            工作城市：<?php echo ($_['basicInfo']->state || $_['basicInfo']->city) ? ($_['basicInfo']->state == $_['basicInfo']->city ? $_['basicInfo']->state : $_['basicInfo']->state.' '.$_['basicInfo']->city) : '未填写'; ?> |
            薪水：<?php echo $_['basicInfo']->salary_type ? $_['basicInfo']->salary_type : '未填写';?> |
            经验：<?php echo $_['basicInfo']->exp_name ? JText::_($_['basicInfo']->exp_name) : '未填写';?> |
            招聘人数：<?php echo $_['basicInfo']->num_needed ? $_['basicInfo']->num_needed : '未填写';?>
         </div>
      </div>
   </div>
</div>

<div class="container">
   <div class="row-fluid">
      <div class="span12">
         <div class="company_qes_fixed large clearfix"><?=$_['basicInfo']->job_title;?>职位线上竞聘</div>
      </div>
   </div>
</div>

<div class="row-fluid hr_oneconn_margin">
   <div class="span12 oneconn_box">
      <div class="lgrg_form">
         <div class="hr_inputinfo">
            <div class="hr_teststep hr_teststep_nomargin">
               <table width="100%" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                     <td width="" class="medium test_ok"><span class="teststep_1"><i></i>核对身份</span></td>
                     <td width="22" class="arrow_blue_blue"></td>
                     <td width="" class="medium test_ok"><span class="teststep_2"><i></i>完善信息</span></td>
                     <?php if ($_['isPaperSet'] && $_['isInviteToken']) :?>
                     <td width="22" class="arrow_blue_blue"></td>
                     <td width="" class="medium test_ok"><span class="teststep_3"><i></i>线上笔试</span></td>
                     <?php endif;?>
                     <td width="22" class="arrow_blue_grey"></td>
                     <td width="" class="medium"><span class="teststep_4"><i></i>完成&nbsp;&nbsp;&nbsp;</span></td>
                  </tr>
               </table>
            </div>
            <div class="hr_testerinfo_input">
               <div class="row-fluid">
                  <div class="span9">
                     <div class="tester_know">
                        <p class="tester_titlec">线上笔试须知<span>(重要)</span></p>
                        <p class="medium">1. 笔试时间<?php echo $_['baseExamInfo'] ? $_['baseExamInfo']->totaltime."分钟" : "未限定";?>。如您暂无时间，可点击“保存信息，下次笔试”，我们将记录您的进度，以便您下次完成；</p>
                        <p class="medium">2. 笔试结束后，请点击"完成并提交"按钮提交试卷。时间结束系统将自动提交您的试卷；</p>
                        <p class="medium">3. 如需帮助或笔试中遇到问题无法完成，请发送邮件至客服 <a href="mailto:support@<?=PUtil::serverDomain()?>">support@<?=PUtil::serverDomain()?></a></p>
                     </div>
                  </div>

                  <div class="span3">
                     <div class="ready_btn">
                        <?php if ($_['takenExamBefore']) :?>
                           <a href="javascript:;" class="ready_btn_width ready_btn_gray">您已参加过笔试</a>
                        <?php else:?>
                           <a href="<?php echo $_['qualifications'] ? OC_Helper::linkToRoute("interview_jobtest", array('token'=>$_['get_token'])) : "javascript:;";?>" class="ppp_bluebtn ready_btn_width <?php echo $_['qualifications'] ? "" : "ready_btn_gray"?>"><?php echo $_['qualifications'] ? "立即开始" : "答题机会已用完"?></a>
                        <?php endif;?>
                     </div>
                     <div class="test_saveaction">
                        <a href="<?=$joinurl?>">保存信息，下次笔试</a>
                     </div>
                  </div>
               </div>
            </div>
         </div>
      </div>
   </div>
</div>
